package com.gklyj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gklyj.mapper.applicationMapper;
import com.gklyj.pojo.Application;
import com.gklyj.service.applicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class applicationServiceImpl extends ServiceImpl<applicationMapper, Application> implements applicationService {

    @Autowired
    applicationMapper applicationMapper;

    //根据条件查询   --审核中
    @Override
    public List<Application> searchApplication(Application application) {
        return applicationMapper.SearchApplication(application);
    }

    //根据条件查询  --审核完成
    @Override
    public List<Application> searchApplication1(Application application) {
        return applicationMapper.SearchApplication1(application);
    }

    //列出审核中的申请信息
    @Override
    public List<Application> listShenhe(Integer u_id,String name) {
        return applicationMapper.listByShenhe(u_id,name);
    }

    //列出审核完成后的申请信息
    @Override
    public List<Application> listShenhe1(Integer u_id,String name) {
        return applicationMapper.listByShenhe1(u_id,name);
    }

    //列出不同状态的申请信息
    @Override
    public List<Application> listApplicationByDepartment(String department,String state) {
        return applicationMapper.listApplicationByDepartment(department,state);
    }

    //根据id修改状态
    @Override
    public boolean UpdateStateById(Integer id, String state) {
        return applicationMapper.updateStateById(id,state);
    }

    @Override
    public List<Application> SearchZpDifferenceApplication(Application application) {
        return applicationMapper.ZpDifferenceApplicationSearch(application);
    }

    @Override
    public Integer GetOneDayOneDepartmentApplicationNumber(String time, String department) {
        return applicationMapper.getOneDayOneDepartmentApplicationNumber(time,department);
    }

    @Override
    public Integer GetNowApplyApplicationNumber(String department) {
        return applicationMapper.getNowApplyApplicationNumber(department);
    }

    @Override
    public Application SearchOneApplication(Application application) {
        return applicationMapper.searchOneApplication(application);
    }

}
